package com.bonjour.work.service;

import com.alibaba.fastjson.JSONObject;
import com.bonjour.common.core.BaseService;
import com.bonjour.work.dao.ResumeDao;
import com.bonjour.work.dto.StandardResume;
import com.bonjour.work.entity.ResumeEntity;
import org.springframework.stereotype.Service;

import javax.inject.Inject;

@Service
public class ResumeService extends BaseService {
    private final ResumeDao resumeDao;

    @Inject
    public ResumeService(ResumeDao resumeDao) {
        this.resumeDao = resumeDao;
    }

    public JSONObject getInfoById(Long rid, Long uid) {
        LOG.info("getResume:"+rid);
        ResumeEntity resume = resumeDao.getResumeById(rid);
        return JSONObject.parseObject(resume.content);
    }

    public JSONObject getInfoByMessage(StandardResume resume, Long uid) {
        LOG.info("getResume:");
//        ResumeEntity resume = resumeDao.getResumeById(rid);
        return JSONObject.parseObject(resume.getBirth());
    }
}
